{include file="public/header" /}
	<h4>修改帐户金额 <span style="font-size:12px;color:red;font-weight:normal">所有改动将会记录数据库</span></h4>
	<div class="row">
		<div class="col-xs-6 col-sm-6">
			<div><label>ID：</label>{$userinfo->mobile}</div>
			<div><label>姓名：</label>{$userinfo->username|default="暂无设置"}</div>
			<div><label>昵称：</label>{$userinfo->nickname}</div>
		</div>
		<div class="col-xs-6 col-sm-6">
			<img src="{$userinfo->pic|default='/static/img/50.png'}" style="margin:0 auto;display:block;width:60px;height:60px;">
		</div>
	</div>

	<form action="" method="POST">
		<input type="hidden" name="__token__" value="{$Request.token}" />
		<input type="hidden" name="mobile" value="{$mobile}" />
		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">充值金额</span>
				<input type="number" name="recharge_money" value="{$userinfo->moneyRelation->recharge_money|default='0'}" class="form-control " placeholder="会员/手机号">
				<span class="input-group-addon">元</span>
			</div>
		</div>

		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">赠送金额</span>
				<input type="number" name="give_money" value="{$userinfo->moneyRelation->give_money|default='0'}" class="form-control " placeholder="会员/手机号">
				<span class="input-group-addon">元</span>
			</div>
		</div>

		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">DIY&nbsp;乐园</span>
				<input type="number" name="diy_times" value="{$userinfo->moneyRelation->diy_times|default='0'}" class="form-control " placeholder="会员/手机号">
				<span class="input-group-addon">次</span>
			</div>
		</div>

		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">吃&nbsp;&nbsp;奶&nbsp;鱼</span>
				<input type="number" name="fish_times" value="{$userinfo->moneyRelation->fish_times|default='0'}" class="form-control " placeholder="会员/手机号">
				<span class="input-group-addon">次</span>
			</div>
		</div>

		<div class="form-group">
			<div class="input-group">
				<span class="input-group-addon" id="basic-addon1">动物滚球</span>
				<input type="number" name="rollball_times" value="{$userinfo->moneyRelation->rollball_times|default='0'}" class="form-control " placeholder="会员/手机号">
				<span class="input-group-addon">次</span>
			</div>
		</div>

	    <button onclick="formSubmit(this)" type="button" class="btn btn-primary btn-block mt20">修改</button>
	    <a class="btn btn-default btn-block" href="{:url('back/account/detail', ['mobile'=>$mobile?$mobile:''])}" >不了，查看详情</a>
	</form>

{include file="public/footer" /}



<script>

function formSubmit(self) {
	var recharge_money = $('input[name=recharge_money]').val(),
	 	give_money = $('input[name=give_money]').val(),
	 	diy_times = $('input[name=diy_times]').val(),
	 	fish_times = $('input[name=fish_times]').val(),
		rollball_times = $('input[name=rollball_times]').val(),

		old_recharge_money = {$userinfo->moneyRelation->recharge_money},
		old_give_money = {$userinfo->moneyRelation->give_money},
		old_diy_times = {$userinfo->moneyRelation->diy_times},
		old_fish_times = {$userinfo->moneyRelation->fish_times},
		old_rollball_times = {$userinfo->moneyRelation->rollball_times};

	var confirmMsg = "修改内容如下：\n";
		confirmMsg += "充值金额："+old_recharge_money+"元-->"+recharge_money+"元\n";
		confirmMsg += "赠送金额："+old_give_money+"元-->"+give_money+"元\n";
		confirmMsg += "DIY乐园："+old_diy_times+"次-->"+diy_times+"次\n";
		confirmMsg += "吃奶鱼："+old_fish_times+"次-->"+fish_times+"次\n";
		confirmMsg += "动物滚球："+old_rollball_times+"次-->"+rollball_times+"次";
	
	if(!confirm(confirmMsg)) {
		return false;
	}

	$(self).parents('form').submit();
}

</script>
